#! python
#coding=utf-8
import math
import numpy as np
import matplotlib.pyplot as plt

if __name__=='__main__':
    x = np.arange(0, 2*math.pi, 0.1);
    sin = np.sin(x);
    cos = np.cos(x);
    line_args=['r.-', 'go-'];
    legends=['sine', 'cosine'];
    plt.plot(x, sin, line_args[0], x, cos, line_args[1]);
    plt.legend((legends[0], legends[1]), loc='upper right');
    plt.xlabel('x');
    plt.ylabel('y');
    plt.grid();
    plt.show();
